<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="css/general.css" type="text/css">
<title>L33T - Registrar Libro</title>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>

</head>
<body>

	<div class="div_header">
		<br> <br> <label style="padding-left: 15px;">Digital Books</label> <br> <br>
	</div>
	<div class="div_line"></div>
	
	<c:if test="${mensaje != '' && not empty mensaje}">
		<div class="${css}">
			${mensaje}
		</div>	
	</c:if>

	<br>
	<br>
	<fieldset>
		<legend class="legend">Register Book</legend>

		<form:form action="registrar.htm" id="frm_registrar" commandName="book">

			<table width="640" cellpadding="4" cellspacing="4">
				<tr>
					<td><label class="titulo">Isbn:</label></td>
					<td><form:input path="isbn" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Title:</label></td>
					<td><input type="text" class="inputField" id="title"
						name="title" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Author:</label>
					</td>
					<td><form:input path="author" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Description:</label>
					</td>
					<td><form:input path="description" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Category:</label>
					</td>
					<td>
						<form:select path="category">
							<option value="Ruby">Ruby</option>
							<option value="iOS">iOS</option>
							<option value="Programming">Programming</option>
							<option value="ASP.NET">ASP.NET</option>
							<option value="Blogging">Blogging</option>
							<option value="Git">Git</option>
							<option value="Design">Design</option>
						</form:select>	
					</td>
				</tr>
				<tr>
					<td><label class="titulo">Year:</label>
					</td>
					<td><form:input path="year" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Pages:</label>
					</td>
					<td><form:input path="pages" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Price:</label></td>
					<td><form:input path="price" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Image:</label>
					</td>
					<td><form:input path="imageUrl" /></td>
				</tr>
				<tr>
					<td><label class="titulo">Book:</label>
					</td>
					<td><form:input path="bookUrl" /></td>
				</tr>
				<tr>
					<td colspan="2">
						<table width=130>
							<tr>
								<td><img id="imgSubmit" alt="Save" src="img/submit.png" border="0">
								</td>
								<td><img id="imgCancel" alt="Cancel" src="img/cancel.png" border="0"></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form:form>
	</fieldset>
	<br>
	<br>
	<div class="back">
		<a href="main_view.htm"><img alt="" src="img/back.png" width="24"
			height="24" border="0"> </a>
	</div>
	
	<script type="text/javascript">
		
		$(document).ready(function() {
			
			$("#imgSubmit").click(function(){
				document.getElementById('frm_registrar').submit();
			});
			
			$("#imgCancel").click(function(){
				window.location.href="main_view.htm";
			});
						
		 });
		
	</script>
</body>
</html>